<template>
	<div>
		<el-form ref="form" :model="form" label-width="80px">
			
			<el-form-item label="用户名">
			  <el-input v-model="form.UserName"></el-input>
			</el-form-item>
			
		  <el-form-item label="账号名称">
		    <el-input v-model="form.LoginName"></el-input>
		  </el-form-item>
		 
		 <el-form-item label="密码">
		   <el-input v-model="form.LoginPwd"></el-input>
		 </el-form-item>
		 
		
		  	
		  <el-form-item>
		    <el-button type="primary" @click="onSubmit">立即创建</el-button>
		    <el-button type="primary" @click="quxiao">取消</el-button>
		  </el-form-item>
		</el-form>
		
	</div>
</template>

<script>
	import LoginApi from '@/api/LoginApi'
		 export default {
		    data() {
		      return {
		        form: {
		         LoginName: '',
		          UserName:'',
				  LoginPwd:'',	      
		        }
		      }
		    },
		    methods: {
		      onSubmit() {
		        LoginApi.add(this.form).then(res=>{
					if (res.code==1) {
						console.log(res);
						this.$message({
							message:"添加成功",
							type:"success"
						})
						this.$emit('close')
					}			
				})
		      },
			  quxiao(){
			  	this.$emit('close')
			  }
		    }
		  }
</script>

<style>
	
</style>